//
// Created by dell on 2025/8/26.
//
#include "iostream"
using namespace std;
int main() {
    // 数组元素移除
    system("chcp 65001");
    int *p_arr01 = new int[5]{1,2,3,4,5};
    int *p_arr02 = new int[4];

    int offset = 0; // 偏移控制量

    for (int i = 0; i < 5; i++) {
        if (i == 2) {
            offset ++;
            continue;
        }
        if (i < 2) {
            p_arr02[i] = p_arr01[i];
        }
        else {
            p_arr02[i-offset] = p_arr01[i];
        }

    }

    cout << p_arr02[0] << endl;
    cout << p_arr02[1] << endl;
    cout << p_arr02[2] << endl;
    cout << p_arr02[3] << endl;



    delete[] p_arr01;
    return 0;
}